
<template>
    <u-form labelWidth="auto" disabled>
      <view>
        <view style="display: flex">
          <view>
            <view class="option" style="width: 520rpx">
              <view class="lf">姓名</view>
              <view class="rl">{{ filterMultiDictText(dictOptions['empId'], item.empId + '') }}</view>
            </view>
<!--   
            <view class="option" style="width: 520rpx">
              <view class="lf">部门</view>
              <view class="rl">{{ item.contractRate }}</view>
            </view> -->

            <view class="option" style="width: 520rpx">
              <view class="lf">所属团队</view>
              <view class="rl">{{ filterMultiDictText(dictOptions['teamId'], item.teamId + '')}}</view>
            </view>
            <view class="option" style="width: 520rpx">
              <view class="lf">预计审核费(元)</view>
              <view class="rl">{{ Number(item.expectedAuditFee).toFixed(2) }}</view>
            </view>
            <view class="option" style="width: 520rpx">
              <view class="lf">扣除比例(%)</view>
              <view class="rl">{{ Number(item.deductionRatio * 100 ) + '%'  }}</view>
            </view>
            <view class="option" style="width: 520rpx">
              <view class="lf">实际审核费(元)</view>
              <view class="rl">{{ Number(item.actualAuditFee).toFixed(2) }}</view>
            </view>
            <view v-if="isSignatureFee" class="option" style="width: 520rpx">
              <view class="lf">签字费(元)</view>
              <view class="rl">{{ Number(item.signatureFee).toFixed(2) }}</view>
            </view>
            <view v-if="!remark" class="option" style="width: 520rpx">
              <view class="lf">备注</view>
              <view class="rl">{{ item.remark }}</view>
            </view>
          </view>
  
          <view style="flex: 1; display: flex; align-items: center; justify-content: flex-end" v-if="!disabled">
            <u-icon v-if="!twoProjectSpecialist || !oneProjectSpecialist" name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item, index)"></u-icon>
            <!-- <u-button size="small" type="primary">完善</u-button> -->
            <u-line direction="col" length="20" margin="0 10rpx"></u-line>
            <u-icon v-if="!oneProjectSpecialist || !twoProjectSpecialist" name="trash-fill" color="red" size="20" @click="handleRemoveForm(item)"></u-icon>
          </view>
        </view>
      </view>
    </u-form>
  </template>
  
  <script>
  import { filterMultiDictText, initDictOptions } from '@/utils/JDictSelectUtil.js'
  
  export default {
    name: 'SecondInstanceReviewForm',
    components: {},
    props: {
      index: {
        type: Number,
        default: null,
      },
      isSignatureFee:{
        type: Boolean,
        default: false,
      },
      item: {
        type: Object,
        default: () => ({}),
      },
      progressVoList: {
        type: Array,
        default: () => [],
      },
      disabled: {
        type: Boolean,
        default: false,
      },
      twoProjectSpecialist: {
        type: Boolean,
        default: false,
      },
      remark:{
        type: Boolean,
        default: false,
        required: false,
      },
      oneProjectSpecialist:{
        type: Boolean,
        default: false,
      }
    },
    data() {
      return {
        filterMultiDictText,
        initDictOptions,
        dictOptions: {},
        smallList: [],
      }
    },
    created(){
       this.initDictConfig()
    },
    watch: {
      item: {
        handler(val) {},
        immediate: true,
        deep: true,
      },
    },
    methods: {
        initDictConfig() {
            initDictOptions('erp_omc_team_manager,alias_name,id').then((res) => {
                if (res.success) {
                this.$set(this.dictOptions, 'teamId', res.result)
                }
            })

      initDictOptions('erp_employee_file,name,id').then((res) => {
        if (res.success) {
          this.$set(this.dictOptions, 'empId', res.result)
        }
      })
    },
      handleCopyForm(item) {
        this.$emit('copy', [item, this.index])
      },
      handleEidtForm(item) {
        this.$emit('edit', [item, this.index])
      },
      handleRemoveForm(item) {
        uni.showModal({
          content: '确定删除吗？',
          success: (res) => {
            if (res.confirm) {
              this.$emit('remove', item)
            }
          },
        })
      },
    },
  }
  </script>
  
  <style scoped lang="scss">
  .inforamtion {
    margin-top: 10rpx;
    padding: 10rpx;
    border-radius: 15rpx;
    box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
  }
  </style>
  